package com.net.oil.product.presenter;

import com.net.oil.base.BasePresenter;
import com.net.oil.product.bean.ProductInfoBean;
import com.net.oil.product.contract.ProductDetailContract;
import com.net.oil.product.model.ProductDetailModel;

/**
 * 作者：lch
 * 时间：2018/4/22 0022:上午 11:04
 * 邮箱：245850413@qq.com
 * 说明：
 */

public class ProductDetailPresenter extends BasePresenter<ProductDetailContract.View> implements ProductDetailContract.Presenter {

    private ProductDetailContract.View view;
    private ProductDetailContract.Model model;

    public ProductDetailPresenter(ProductDetailContract.View view) {
        this.view = view;
        model = new ProductDetailModel(this);
    }

    @Override
    public void getProductDetail(int id) {
        model.getProductDetail(id);
    }

    @Override
    public void getProductDetailSuccess(ProductInfoBean productInfoBean) {
        view.getProductDetailSuccess(productInfoBean);
    }

    @Override
    public void getProductDetailFailed() {
        view.getProductDetailFailed();
    }

    @Override
    protected void unSubscribe() {
        model.unSubscribe();
    }
}
